/**
 * Company : SIANGKLOM.
 * Created By : Chatree Siangklom
 * Created On : Aug 21, 2013  5:41:35 PM 
 * e-Mail : dr_chatree@hotmail.com
 * Mobile Phone : (+66) 087-921-5115
 * Package Name : com.tis.database.entitys
 * File Name : AGenDesc.java
 * TODO
 */

package com.tis.database.entitys;

import java.io.Serializable;

import javax.persistence.*;

import org.apache.commons.lang.builder.ToStringBuilder;

import java.math.BigDecimal;
import java.util.Date;


/**
 * The persistent class for the A_GEN_DESC database table.
 * 
 */
@Entity
@Table(name="A_GEN_DESC")
@NamedQueries({
    @NamedQuery(name = AGenDesc.findAll, query = "FROM AGenDesc c "),
    @NamedQuery(name = AGenDesc.findInID, query = "FROM AGenDesc c WHERE c.pkId in(:pkId) Order by :p_orderby "),
    @NamedQuery(name = AGenDesc.findById, query = "FROM AGenDesc c WHERE  c.pkId = :pkId "),
    @NamedQuery(name = AGenDesc.findByaGenCodeId, query = "FROM AGenDesc c WHERE c.aGenCodeId = :aGenCodeId "),
    @NamedQuery(name = AGenDesc.findByaGenTypeId, query = "FROM AGenDesc c WHERE c.aGenTypeId = :aGenTypeId ")
    })
public class AGenDesc implements Serializable {
	private static final long serialVersionUID = 1L;	
	
	public static final String findAll = "AGenDesc_findAll";
	public static final String findInID = "AGenDesc_findInID";
	public static final String findById = "AGenDesc_findById";
	public static final String findByaGenCodeId = "AGenDesc_findByaGenCodeId";
	public static final String findByaGenTypeId = "AGenDesc_findByaGenTypeId";
	
	@Id
	@Column(name="A_GEN_DESC_ID")
	private BigDecimal pkId;

	@Column(name="A_GEN_CODE_ID")
	private BigDecimal aGenCodeId;

	@Column(name="A_GEN_TYPE_ID")
	private BigDecimal aGenTypeId;

	@Column(name="CREATED_BY")
	private String createdBy;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="CREATED_ON")
	private Date createdOn;

	@Column(name="DESCRIPTION")
	private String description;

	@Column(name="ISACTIVE")
	private String isactive;

	@Column(name="MSG_CODE")
	private String msgCode;

	@Column(name="MSG_DESC")
	private String msgDesc;

	@Column(name="REF_A_GEN_DESC_ID")
	private BigDecimal refAGenDescId;

	@Column(name="STATUS")
	private String status;

	@Column(name="UPDATED_BY")
	private String updatedBy;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="UPDATED_ON")
	private Date updatedOn;
	
	@Column(name="VALUE1")
	private String value1;

	@Column(name="VALUE2")
	private String value2;

	@Column(name="VALUE3")
	private String value3;

	@Column(name="VALUE4")
	private String value4;

	@Column(name="VALUE5")
	private String value5;

	public AGenDesc() {
	}
	
	public AGenDesc(BigDecimal pkId) {
		this.pkId = pkId;
	}

	/**
	 * @return the pkId
	 */
	public BigDecimal getPkId() {
		return pkId;
	}

	/**
	 * @param pkId the pkId to set
	 */
	public void setPkId(BigDecimal pkId) {
		this.pkId = pkId;
	}



	public BigDecimal getAGenCodeId() {
		return this.aGenCodeId;
	}

	public void setAGenCodeId(BigDecimal aGenCodeId) {
		this.aGenCodeId = aGenCodeId;
	}

	public BigDecimal getAGenTypeId() {
		return this.aGenTypeId;
	}

	public void setAGenTypeId(BigDecimal aGenTypeId) {
		this.aGenTypeId = aGenTypeId;
	}

	public String getCreatedBy() {
		return this.createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public Date getCreatedOn() {
		return this.createdOn;
	}

	public void setCreatedOn(Date createdOn) {
		this.createdOn = createdOn;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getIsactive() {
		return this.isactive;
	}

	public void setIsactive(String isactive) {
		this.isactive = isactive;
	}

	public String getMsgCode() {
		return this.msgCode;
	}

	public void setMsgCode(String msgCode) {
		this.msgCode = msgCode;
	}

	public String getMsgDesc() {
		return this.msgDesc;
	}

	public void setMsgDesc(String msgDesc) {
		this.msgDesc = msgDesc;
	}

	public BigDecimal getRefAGenDescId() {
		return this.refAGenDescId;
	}

	public void setRefAGenDescId(BigDecimal refAGenDescId) {
		this.refAGenDescId = refAGenDescId;
	}

	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getUpdatedBy() {
		return this.updatedBy;
	}

	public void setUpdatedBy(String updatedBy) {
		this.updatedBy = updatedBy;
	}

	public Date getUpdatedOn() {
		return this.updatedOn;
	}

	public void setUpdatedOn(Date updatedOn) {
		this.updatedOn = updatedOn;
	}

	public String getValue1() {
		return this.value1;
	}

	public void setValue1(String value1) {
		this.value1 = value1;
	}

	public String getValue2() {
		return this.value2;
	}

	public void setValue2(String value2) {
		this.value2 = value2;
	}

	public String getValue3() {
		return this.value3;
	}

	public void setValue3(String value3) {
		this.value3 = value3;
	}

	public String getValue4() {
		return this.value4;
	}

	public void setValue4(String value4) {
		this.value4 = value4;
	}

	public String getValue5() {
		return this.value5;
	}

	public void setValue5(String value5) {
		this.value5 = value5;
	}
	
	@Override
	public String toString()
	{
		return ToStringBuilder.reflectionToString(this);
	}



	/**
	 * @param pkId
	 * @param aGenCodeId
	 * @param aGenTypeId
	 * @param createdBy
	 * @param createdOn
	 * @param description
	 * @param isactive
	 * @param msgCode
	 * @param msgDesc
	 * @param refAGenDescId
	 * @param status
	 * @param updatedBy
	 * @param updatedOn
	 * @param value1
	 * @param value2
	 * @param value3
	 * @param value4
	 * @param value5
	 */
	public AGenDesc(BigDecimal pkId, BigDecimal aGenCodeId, BigDecimal aGenTypeId,
			String createdBy, Date createdOn, String description,
			String isactive, String msgCode, String msgDesc,
			BigDecimal refAGenDescId, String status, String updatedBy,
			Date updatedOn, String value1, String value2, String value3,
			String value4, String value5) {
		this.pkId = pkId;
		this.aGenCodeId = aGenCodeId;
		this.aGenTypeId = aGenTypeId;
		this.createdBy = createdBy;
		this.createdOn = createdOn;
		this.description = description;
		this.isactive = isactive;
		this.msgCode = msgCode;
		this.msgDesc = msgDesc;
		this.refAGenDescId = refAGenDescId;
		this.status = status;
		this.updatedBy = updatedBy;
		this.updatedOn = updatedOn;
		this.value1 = value1;
		this.value2 = value2;
		this.value3 = value3;
		this.value4 = value4;
		this.value5 = value5;
	}



	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((aGenCodeId == null) ? 0 : aGenCodeId.hashCode());
		result = prime * result
				+ ((aGenTypeId == null) ? 0 : aGenTypeId.hashCode());
		result = prime * result
				+ ((createdBy == null) ? 0 : createdBy.hashCode());
		result = prime * result
				+ ((createdOn == null) ? 0 : createdOn.hashCode());
		result = prime * result
				+ ((description == null) ? 0 : description.hashCode());
		result = prime * result
				+ ((isactive == null) ? 0 : isactive.hashCode());
		result = prime * result + ((msgCode == null) ? 0 : msgCode.hashCode());
		result = prime * result + ((msgDesc == null) ? 0 : msgDesc.hashCode());
		result = prime * result + ((pkId == null) ? 0 : pkId.hashCode());
		result = prime * result
				+ ((refAGenDescId == null) ? 0 : refAGenDescId.hashCode());
		result = prime * result + ((status == null) ? 0 : status.hashCode());
		result = prime * result
				+ ((updatedBy == null) ? 0 : updatedBy.hashCode());
		result = prime * result
				+ ((updatedOn == null) ? 0 : updatedOn.hashCode());
		result = prime * result + ((value1 == null) ? 0 : value1.hashCode());
		result = prime * result + ((value2 == null) ? 0 : value2.hashCode());
		result = prime * result + ((value3 == null) ? 0 : value3.hashCode());
		result = prime * result + ((value4 == null) ? 0 : value4.hashCode());
		result = prime * result + ((value5 == null) ? 0 : value5.hashCode());
		return result;
	}



	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (!(obj instanceof AGenDesc)) {
			return false;
		}
		AGenDesc other = (AGenDesc) obj;
		if (aGenCodeId == null) {
			if (other.aGenCodeId != null) {
				return false;
			}
		} else if (!aGenCodeId.equals(other.aGenCodeId)) {
			return false;
		}
		if (aGenTypeId == null) {
			if (other.aGenTypeId != null) {
				return false;
			}
		} else if (!aGenTypeId.equals(other.aGenTypeId)) {
			return false;
		}
		if (createdBy == null) {
			if (other.createdBy != null) {
				return false;
			}
		} else if (!createdBy.equals(other.createdBy)) {
			return false;
		}
		if (createdOn == null) {
			if (other.createdOn != null) {
				return false;
			}
		} else if (!createdOn.equals(other.createdOn)) {
			return false;
		}
		if (description == null) {
			if (other.description != null) {
				return false;
			}
		} else if (!description.equals(other.description)) {
			return false;
		}
		if (isactive == null) {
			if (other.isactive != null) {
				return false;
			}
		} else if (!isactive.equals(other.isactive)) {
			return false;
		}
		if (msgCode == null) {
			if (other.msgCode != null) {
				return false;
			}
		} else if (!msgCode.equals(other.msgCode)) {
			return false;
		}
		if (msgDesc == null) {
			if (other.msgDesc != null) {
				return false;
			}
		} else if (!msgDesc.equals(other.msgDesc)) {
			return false;
		}
		if (pkId == null) {
			if (other.pkId != null) {
				return false;
			}
		} else if (!pkId.equals(other.pkId)) {
			return false;
		}
		if (refAGenDescId == null) {
			if (other.refAGenDescId != null) {
				return false;
			}
		} else if (!refAGenDescId.equals(other.refAGenDescId)) {
			return false;
		}
		if (status == null) {
			if (other.status != null) {
				return false;
			}
		} else if (!status.equals(other.status)) {
			return false;
		}
		if (updatedBy == null) {
			if (other.updatedBy != null) {
				return false;
			}
		} else if (!updatedBy.equals(other.updatedBy)) {
			return false;
		}
		if (updatedOn == null) {
			if (other.updatedOn != null) {
				return false;
			}
		} else if (!updatedOn.equals(other.updatedOn)) {
			return false;
		}
		if (value1 == null) {
			if (other.value1 != null) {
				return false;
			}
		} else if (!value1.equals(other.value1)) {
			return false;
		}
		if (value2 == null) {
			if (other.value2 != null) {
				return false;
			}
		} else if (!value2.equals(other.value2)) {
			return false;
		}
		if (value3 == null) {
			if (other.value3 != null) {
				return false;
			}
		} else if (!value3.equals(other.value3)) {
			return false;
		}
		if (value4 == null) {
			if (other.value4 != null) {
				return false;
			}
		} else if (!value4.equals(other.value4)) {
			return false;
		}
		if (value5 == null) {
			if (other.value5 != null) {
				return false;
			}
		} else if (!value5.equals(other.value5)) {
			return false;
		}
		return true;
	}
	
	
}